package bavaria.hightech.testit;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import bavaria.hightech.b2b.B2B;
import bavaria.hightech.b2b.BankRegistry;
import bavaria.hightech.banking.BankImpl;

public class BankRegistryTest {
	private BankRegistry registry;
	private B2B bank1;
	private String bankName1;

	@Before
	public void setUp() throws Exception {
		registry = BankRegistry.getInstance();
		bankName1 = "Raiffeisenbank Staunden eG";
		bank1 = new BankImpl(bankName1, 2, 5);
	}

	@Test
	public void testBind() {
		registry.bind(bankName1, bank1);
	}

	@Test
	public void testLookup() {
		registry.bind(bankName1, bank1);
		assertEquals(bank1, registry.lookup(bankName1));
		
	}

	@Test
	public void testAssignEvent() {
		registry.bind(bankName1, bank1);
		assertEquals(bank1, registry.assignEvent(bankName1));
	}

}
